import React, { Component } from 'react'
import "./header.less"
import {Link,withRouter} from "react-router-dom"

class header extends Component {
  render() {
      let {text,back,register} = this.props
    return (
      <div className='header'>
          {back?<span className='back' onClick={()=>{this.props.history.go(-1)}}>返回</span>:null}
          <div className='text'>{text}</div>
          {register?<Link className='register' to="/register">注册</Link>:null}
      </div>



    )
  }
}
export default withRouter(header)